{include file="common/_meta" /}

<title>友情链接添加</title>
</head>
<body>
<div class="page-container">
	
	<div class="panel panel-danger">
	    <div class="panel-header">注意</div>
	    <div class="panel-body"> 收货地址，如果不填写就是刚才选择的人信息。时间不填写就是，现在的时间！
		</div>
	</div>
	
	
	<form action="" method="post"  class="form form-horizontal" id="form-category-add">
		<div id="tab-category" class="HuiTab">
			<div class="tabCon">
	
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						<span style="color: red;cursor: pointer;" id="xuanchan">选择</span>
						产品id：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" id="goods_id" name="goods_id" readonly>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						产品名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" id="goods_name" readonly >
					</div>
					<div class="col-3">
					</div>
				</div>
				
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						商品单价：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" id="shop_price" readonly>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						商品数量：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="number" min="1" class="input-text" name='goods_num' id="number" value="1">
					</div>
					<div class="col-3">
					</div>
				</div>

				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						付款金额：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" id="goods_price_zong" readonly>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						支付方式：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box" style="width:30%">
						<select name='payment' class="select" >
							<option selected value="1">支付宝支付</option>
							<option   value="2">微信支付</option>	
							<option value="3">余额支付</option>
							<option   value="4">积分兑换</option>
						</select>
						</span>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						收货人姓名：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" name="shou_name">
					</div>
					<div class="col-3">
					</div>
				</div> 
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						收货人电话：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" name='shou_phone'>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						收货人地区：</label>
					<div class="formControls col-xs-3 col-sm-3">
						<span class="select-box">
						  <select onchange="shengbian()" class="select" size="1" name="sheng" id='sheng'>
						    <option value="">请选择</option>
							{volist name="sheng" id="vo"}
							<option value="{$vo.id}">{$vo.label}</option>
							{/volist}
						  </select>
						</span>
					</div>
					<div class="formControls col-xs-3 col-sm-3">
						<span class="select-box">
						  <select onchange="shibian()" class="select" size="1" name="shi" id="shi">
							<option value="">请选择</option>
						  </select>
						</span>
					</div>
					<div class="formControls col-xs-3 col-sm-3">
						<span class="select-box">
						  <select class="select" size="1" name="xian" id="xian">
						    <option value="">请选择</option>
						  </select>
						</span>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						收货人地址：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" name='shou_address'>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-3 col-sm-2">
						支付时间：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="datetime-local" class="input-text" value="" name="pay_time">
					</div>
					<div class="col-3">
					</div>
				</div>
				
				
				
				
				
				<div class="row cl">
					<div class="col-9 col-offset-2">
						<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
{include file="common/_footer" /}

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript" src="__MANAGE__lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="__MANAGE__lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="__MANAGE__lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#tab-category").Huitab({
		index:0
	});
	$("#form-category-add").validate({
		rules:{
			title:{
				required:true,
			},
			linkurl:{
				required:true,
				url:true,
			},
		}
	});

});
function textlength(){
	var nmb=$('#desc').val().length;
	$('.textarea-length').text(nmb);
	if(nmb>100){
		$('#desc').css("background-color","orangered");
	}else{
		$('#desc').css("background-color","white");
	}
}

$('#xuanchan').click(function(){
	layer_show('选择产品','{:url("order/xuan")}');
})
$('#xuanren').click(function(){
	layer_show('选择人员','{:url("order/ren")}');
})

$('#number').change(function(){
	let num=$(this).val()
	let dan=$('#shop_price').val()
	let zhi= Number(num)*Number(dan)
	$('#goods_price_zong').val(zhi)
})
function shengbian(){
	let sheng_id=$('#sheng').val()
	$.post(
		"{:url('order/ajax')}",
	{
		id:sheng_id,
		type:'get_shi',
	},
	function(res){
	    if(res.code==1){
			let html='<option value="">请选择</option>'
			for (let s of res.data) {
				html+='<option value="'+s.id+'">'+s.label+'</option>'
			}
			
			$('#shi').html(html)
			$('#xian').html('<option value="">请选择</option>')
		}else{
			layer.msg('获取错误',{
				icon:5
			})
		}
	});	
}
function shibian(){
	let shi_id=$('#shi').val()
	$.post(
		"{:url('order/ajax')}",
	{
		id:shi_id,
		type:'get_shi',
	},
	function(res){
	    if(res.code==1){
			let html='<option value="">请选择</option>'
			for (let s of res.data) {
				html+='<option value="'+s.id+'">'+s.label+'</option>'
			}
			
			$('#xian').html(html)
			
		}else{
			layer.msg('获取错误',{
				icon:5
			})
		}
	});	
}

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>